home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
examples
/
exam06
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-27
|
2KB
|
111 lines
/*
*
* This source code is CONFIDENTIAL and
* PROPRIETARY to Algorithms Corporation. Unauthorized
* distribution, adaptation or use may
* be subject to civil and criminal penalties.
*
* Copyright (c) 1993 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37064
*
* ALL RIGHTS RESERVED.
*
*
*
*/
#include "generics.h"
main(int argc, char *argv[])
{
object strDict;
InitDynace(&argc);
/* Create a new StringDictionary to hold roughly 49 elements.
Note that although the dictionary is set up to hold roughly 49
elements, it may actually hold any number, it's just that
the effeciency of the dictionary will start to go down at
arount 49 elements. */
strDict = gNewWithInt(StringDictionary, 49);
/* Print the entire link object out */
gPrint(strDict, stdoutStream);
/* Add a new object to the dictionary and print */
gAddStr(strDict, "Key 1", gNewWithStr(String, "The first value added."));
gPrint(strDict, stdoutStream);
/* Add a new object to the beginning of the list and print */
gAddStr(strDict, "Other key", gNewWithDouble(DoubleFloat, 3.14159));
gPrint(strDict, stdoutStream);
/* Add a new object to the end of the list and print */
gAddStr(strDict, "abcd", gNewWithLong(LongInteger, 186282L));
gPrint(strDict, stdoutStream);
/* Find and print the value associated with "Other key" */
gPrint(gFindValueStr(strDict, "Other key"), stdoutStream);
/* Dispose of one of the key/value pairs and print dictionary */
gDeepDisposeStr(strDict, "Key 1");
gPrint(strDict, stdoutStream);
/* Dispose of the entire link object and all objects held */
/* (again only necessary of garbage collector not used) */
gDeepDispose(strDict);
return 0;
}
/*
*
* This source code is CONFIDENTIAL and
* PROPRIETARY to Algorithms Corporation. Unauthorized
* distribution, adaptation or use may
* be subject to civil and criminal penalties.
*
* Copyright (c) 1993 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37064
*
* ALL RIGHTS RESERVED.
*
*
*
*/